// 核心模块定义
const CoreModules = {
    // API相关模块
    API: {
        name: 'api-client',
        path: '../scripts/api-client.js'
    },
    
    // 数据管理模块
    DATA_MANAGER: {
        name: 'data-manager',
        path: '../scripts/data-manager.js'
    },
    
    // 同步系统模块
    SYNC_SYSTEM: {
        name: 'sync-system',
        path: '../scripts/sync-system.js'
    },
    
    // 导航相关模块
    NAVIGATION: {
        NAVBAR: {
            name: 'navbar-main',
            path: '../scripts/navbar-main.js'
        },
        SIDEBAR: {
            name: 'sidebar-manager',
            path: '../scripts/sidebar-manager.js'
        },
        PAGE_SYNC: {
            name: 'page-sync-manager',
            path: '../scripts/page-sync-manager.js'
        }
    },
    
    // 页面特定模块
    PAGES: {
        DASHBOARD: {
            name: 'dashboard-main',
            path: '../scripts/dashboard-main.js'
        },
        BLOG: {
            name: 'blog-manager',
            path: '../scripts/blog-manager.js'
        },
        GALLERY: {
            name: 'gallery',
            path: '../scripts/gallery.js'
        },
        LOGS: {
            name: 'logs',
            path: '../scripts/logs.js'
        },
        MESSAGES: {
            name: 'messages',
            path: '../scripts/messages.js'
        },
        PRODUCTS: {
            name: 'products',
            path: '../scripts/products.js'
        },
        SYSTEM_SETTINGS: {
            name: 'system-settings',
            path: '../scripts/system-settings.js'
        }
    },
    
    // 工具模块
    UTILITIES: {
        VISITOR_ANALYTICS: {
            name: 'visitor-analytics',
            path: '../scripts/visitor-analytics.js'
        },
        OPTIMIZATION: {
            name: 'optimization',
            path: '../scripts/optimization.js'
        }
    }
};

// 页面模块配置
const PageModules = {
    'dashboard.html': [
        CoreModules.API,
        CoreModules.DATA_MANAGER,
        CoreModules.SYNC_SYSTEM,
        CoreModules.NAVIGATION.NAVBAR,
        CoreModules.NAVIGATION.SIDEBAR,
        CoreModules.NAVIGATION.PAGE_SYNC,
        CoreModules.PAGES.DASHBOARD
    ],
    'blog.html': [
        CoreModules.API,
        CoreModules.NAVIGATION.NAVBAR,
        CoreModules.PAGES.BLOG
    ],
    'gallery.html': [
        CoreModules.API,
        CoreModules.NAVIGATION.NAVBAR,
        CoreModules.PAGES.GALLERY
    ],
    'logs.html': [
        CoreModules.API,
        CoreModules.NAVIGATION.NAVBAR,
        CoreModules.NAVIGATION.SIDEBAR,
        CoreModules.PAGES.LOGS
    ],
    'messages.html': [
        CoreModules.API,
        CoreModules.NAVIGATION.NAVBAR,
        CoreModules.NAVIGATION.SIDEBAR,
        CoreModules.PAGES.MESSAGES
    ],
    'products.html': [
        CoreModules.API,
        CoreModules.NAVIGATION.NAVBAR,
        CoreModules.NAVIGATION.SIDEBAR,
        CoreModules.PAGES.PRODUCTS
    ],
    'system-settings.html': [
        CoreModules.API,
        CoreModules.NAVIGATION.NAVBAR,
        CoreModules.NAVIGATION.SIDEBAR,
        CoreModules.PAGES.SYSTEM_SETTINGS
    ]
};

// 模块加载配置
window.CoreModules = CoreModules;
window.PageModules = PageModules;